package com.renting.common.entity;

import com.alibaba.fastjson.annotation.JSONField;

import javax.persistence.MappedSuperclass;
import javax.persistence.Transient;

@MappedSuperclass
public class PageParam {
    @Transient
    @JSONField(serialize=false)
    private Integer pageNoParam;//页数
    @Transient
    @JSONField(serialize=false)
    private Integer pageSizeParam;//页数
    @Transient
    @JSONField(serialize=false)
    private Integer pageStarterParam;

    public Integer getPageNoParam() {
        return pageNoParam;
    }

    public void setPageNoParam(int pageNoParam) {
        this.pageNoParam = pageNoParam;
    }

    public Integer getPageSizeParam() {
        return pageSizeParam;
    }

    public void setPageSizeParam(int pageSizeParam) {
        this.pageSizeParam = pageSizeParam;
    }

    public Integer getPageStarterParam() {
        return (pageNoParam - 1) * pageSizeParam;
    }

    public void setPageStarterParam(int pageStarterParam) {
        this.pageStarterParam = pageStarterParam;
    }
}
